<!DOCTYPE html>
<!--suppress ES6ConvertVarToLetConst -->
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        //编写JavaScript对象
        var user={
            name:"马富",
            age:3,
            sex:"男"
        };
        console.log(user);
        //将js对象转换为json对象
        var json=JSON.stringify(user);
        console.log(json);
        //将json字符串转换为js对象
        var user2=JSON.parse(json);
        console.log(user2);


    </script>


</head>
<body>

</body>
</html>